﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.ComponentModel.Design;

namespace VSS_AHT
{
    public partial class BaseForm : DevExpress.XtraEditors.XtraForm
    {
        #region Variables

        protected ServiceContainer svc;

        #endregion

        #region Constructors & destructor

        public BaseForm()
        {
            InitializeComponent();

            svc = new ServiceContainer();
        }

        ~BaseForm()
        {
            svc.Dispose();
            this.Dispose();
        }
        #endregion

        #region Events
        protected override void OnLoad(EventArgs e)
        {
            this.OnEvents();
            this.OnLoadData();
            this.LockControls(false);

            base.OnLoad(e);
        }

        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{TAB}");
            base.OnKeyDown(e);
        }
        #endregion

        #region Virtual Methods
        protected virtual void OnEvents() { }
        protected virtual void OnLoadData() { }
        protected virtual void LockControls(bool state) { }
        #endregion
    }
}